package keter.combofs.model;

import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Maps;

import java.util.Map;

/**
 * Created by gulx@neusoft.com on 2019/11/11.
 */
public class FileMeta {
    private Map<String,String> map = Maps.newHashMap();

    public static FileMeta build(){
        return new FileMeta();
    }

    public  FileMeta set(String jsonMeta){
        map = JSONObject.parseObject(jsonMeta, Map.class);
        return this;
    }

    public  FileMeta add(String name,String value){
        map.put(name,value);
        return this;
    }

    public  String get(){
        return JSONObject.toJSONString(map);
    }

    public  Map getData(){
        return map;
    }

    public  String get(String key){
        return map.get(key);
    }

}
